package com.binary.coder.gift.core.application.bill;


import com.binary.coder.gift.core.common.bean.PageBean;
import com.binary.coder.gift.core.domain.bill.AccountService;
import com.binary.coder.gift.core.domain.bill.model.entity.AccountBookEntity;
import com.binary.coder.gift.core.domain.bill.model.entity.AccountRecordEntity;
import com.binary.coder.gift.core.interfaces.bill.dto.req.PageQueryAccountBookReq;
import com.binary.coder.gift.core.interfaces.bill.dto.req.PageQueryAccountRecordReq;
import com.binary.coder.gift.core.interfaces.bill.dto.res.PageQueryAccountBookRes;
import com.binary.coder.gift.core.interfaces.bill.dto.res.PageQueryAccountRecordRes;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author weitao
 */
@Component
public class AccountApplication {

    @Resource
    private AccountService accountService;

    public void saveAccountRecord(AccountRecordEntity entity) {
        accountService.saveAccountRecord(entity);
    }

    public PageBean<PageQueryAccountRecordRes> pageQueryAccountRecord(PageQueryAccountRecordReq req) {
        return accountService.pageQueryAccountRecord(req);
    }

    public void saveAccountBook(AccountBookEntity accountBookEntity) {
        accountService.saveAccountBook(accountBookEntity);
    }

    public PageBean<PageQueryAccountBookRes> pageQueryAccountBook(PageQueryAccountBookReq req) {
        return accountService.pageQueryAccountBook(req);
    }
}
